Production systems have experienced rapid growth over the past few years. Based on geothermal energy, the present study explores a unique cogeneration system that includes a proton membrane electrolyzer, the Rankine cycle, and a water-ammonia absorption chiller. The model under study is designed to generate power and hydrogen, as well as cooling, and it is analyzed from an energy and exergy standpoint. For the desuperheater and the absorber, the maximum rate of exergy destruction of the Rankin cycle is 34% and 36%, respectively. Furthermore, a parametric analysis of the system was conducted, and the cogeneration system was optimized from three perspectives: turbine production power, energy efficiency, and exergy. Based on turbine inlet and outlet pressure, turbine power, energy efficiency, and system efficiency are optimized. Moreover, the optimization calculations made from the perspective of turbine production power show that production power values are 101 kW, hydrogen production is 4. 24 liters per second, system energy efficiency is 82. 3%, and the amount of heat absorbed in the evaporator is 57. 6 kW.